import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs"
const baseUrl =  Vue.prototype.$itsoftUI.config.serviceUrl  + "/repair"

//大维修api
export const repairBigfixCheckApi = {
    GetByrepairId: function (repairId) {
        const data = {
            repairId
        }
        return request({
            url: baseUrl + "/repairBigfixCheck/getByrepairId",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //根据repairId获取审批人列表(申请大维修时专用)
    GetUserByRepairId: function (repairId) {
        const data = {
            repairId
        }
        return request({
            url: baseUrl + "/repairBigfixCheck/getUserByRepairId",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //根据id查找大维修申请详情
    GetByCheckId: function (checkId) {
        const data = {
            checkId
        }
        return request({
            url: baseUrl + "/repairBigfixCheck/getByCheckId",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //根据报修id查找大维修申请详情(异常工单专用)
    GetByRepairId: function (repairId) {
        const data = {
            repairId
        }
        return request({
            url: baseUrl + "/repairBigfixCheck/getByRepairId",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //被我操作的
    GetAllListByUserId: function (pageNumber, pageSize, searchValue, startDate, endDate, type) {
        const data = {
            pageNumber,
            pageSize,
            searchValue,
            startDate,
            endDate,
            type
        }
        return request({
            url: baseUrl + "/repairBigfixCheck/getAllListByUserId",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //我的录单
    GetInputByUserId: function (pageNumber, pageSize, searchValue, startDate, endDate, type) {
        const data = {
            pageNumber,
            pageSize,
            searchValue,
            startDate,
            endDate,
            type
        }
        return request({
            url: baseUrl + "/repairBigfixCheck/getInputByUserId",
            method: "post",
            data: qs.stringify(data)
        });
    },
    GetListByUserId: function (pageNumber, pageSize, searchValue) {
        const data = {
            pageNumber,
            pageSize,
            searchValue
        }
        return request({
            url: baseUrl + '/repairBigfixCheck/getListByUserId',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    Save: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/repairBigfixCheck/save", data, config)
    },
    CheckSave: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/repairBigfixCheck/checkSave", data, config)
    }
}